package converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import repository.WorkPostRepository;
import domain.WorkPost;

@Component
public class WorkPostConverter implements Converter<String, WorkPost>{
	
	private WorkPostRepository WorkPostRepository;
	
	@Autowired
	public WorkPostConverter(WorkPostRepository WorkPostRepository) {
		this.WorkPostRepository = WorkPostRepository;
	}

	@Override
	public WorkPost convert(String source) {
		return WorkPostRepository.get(Integer.valueOf(source));
	}

}
